package comprehensive_case;

public class 数字解密 {
    public static void main(String[] args) {
        int number = 8346;
        int temp = number;
        // 将数字放到数组中
        int count = 0;
        while (number != 0) {
            number = number / 10;
            count++;
        }
        int[] arr = new int[count];
        int index = arr.length - 1;
        while (temp != 0) {
            int ge = temp % 10;
            temp = temp / 10;
            arr[index] = ge;
            index--;
        }
        for (int i = 0, j = arr.length - 1; i < j; i++, j--) {
            int temp1 = arr[i];
            arr[i] = arr[j];
            arr[j] = temp1;
        }

        for (int i = 0; i < arr.length; i++) {
            if (arr[i] >= 1 && arr[i] <= 4) {
                arr[i] += 10;
            }
        }
        for (int i = 0; i < arr.length; i++) {
            arr[i] -= 5;
        }
        int result = 0;
        for (int i = 0; i < arr.length; i++) {
            result = result * 10 + arr[i];
        }
        System.out.println(result);
    }
}
